<j:ebuttons
  [searchPlaceholder]="'BasicArchives::UI:SimplyEntity.JButtons.SearchPlaceholder' | abpLocalization"
  [editState]="editState"
  [submitBtnVisible]="false"
  [backBtnVisible]="false"
  [approveBtnVisible]="false"
  [unapproveBtnVisible]="false"
  [approveDividerVisible]="false"
  [selectBtnVisible]="false"
  [listBtnVisible]="false"
  [searchDividerVisible]="false"
  [saveBtnDisabledFn]="isSaveBtnDisabled"
  (saveBtnClick)="save()"
  (giveupBtnClick)="giveup()"
  (newBtnClick)="new()"
  (copyBtnClick)="copy()"
  (deleteBtnClick)="delete()"
  (refreshBtnClick)="refresh()"
  (searchBtnClick)="search($event)"
>
</j:ebuttons>

<nz-card class="main-card">
  <form nz-form [formGroup]="validateForm">
    <nz-tabset nzType="card">
      <nz-tab [nzTitle]="'BasicArchives::UI:SimplyEntity.CardTitle.Base' | abpLocalization">
        <div nz-row>
          <div nz-col [nzSpan]="8">
            <nz-form-item>
              <nz-form-label [nzSm]="8" [nzXs]="24" [nzRequired]="!codeInputDisabled" nzFor="code">
                <a nz-button nzType="link" class="ref-form-label" (click)="uniqueCodeSetting()">
                  {{ 'BasicArchives::ModelTitle:Joy.Erp.BasicArchives.ItemMasters.ItemMaster.Code' | abpLocalization }}
                </a>
              </nz-form-label>
              <nz-form-control [nzSm]="14" [nzXs]="24" nzHasFeedback>
                <input
                  nz-input
                  id="code"
                  formControlName="code"
                  [placeholder]="'BasicArchives::ModelPlaceHolder:Joy.Erp.BasicArchives.ItemMasters.ItemMaster.Code' | abpLocalization"
                  [readonly]="codeInputDisabled"
                  [ngClass]="{ 'input-disabled': codeInputDisabled }"
                  nz-tooltip
                  [nzTooltipTitle]="getErrorMessage('code')"
                  [nzTooltipVisible]="validateForm.get('code')?.invalid && validateForm.get('code')?.touched"
                  nzTooltipPlacement="top"
                />
              </nz-form-control>
            </nz-form-item>
          </div>
          <div nz-col [nzSpan]="8">            
            <nz-form-item>
              <nz-form-label [nzSm]="8" [nzXs]="24" nzRequired nzFor="itemCategoryId">
                {{ 'BasicArchives::ModelTitle:Joy.Erp.BasicArchives.ItemMasters.ItemMaster.ItemCategoryId' | abpLocalization }} 
              </nz-form-label>
              <nz-form-control [nzSm]="14" [nzXs]="24" nzHasFeedback>
                <nz-tree-select
                  id="itemCategoryId"
                  formControlName="itemCategoryId"
                  [nzPlaceHolder]="'BasicArchives::ModelPlaceHolder:Joy.Erp.BasicArchives.ItemMasters.ItemMaster.ItemCategoryId' | abpLocalization"
                  [nzNodes]="itemCategoryTreeData"
                  [nzShowSearch]="true"
                  [nzAllowClear]="true"
                  [nzDropdownStyle]="{ maxHeight: '300px', overflow: 'auto' }"
                  nz-tooltip
                  [nzTooltipTitle]="getErrorMessage('itemCategoryId')"
                  [nzTooltipVisible]="validateForm.get('itemCategoryId')?.invalid && validateForm.get('itemCategoryId')?.touched"
                  nzTooltipPlacement="top"
                >
                </nz-tree-select>
              </nz-form-control>
            </nz-form-item>
          </div>
          <div nz-col [nzSpan]="8">
          </div>
          <div nz-col [nzSpan]="8">            
            <nz-form-item>
              <nz-form-label [nzSm]="8" [nzXs]="24" nzRequired nzFor="name">
                {{ 'BasicArchives::ModelTitle:Joy.Erp.BasicArchives.ItemMasters.ItemMaster.Name' | abpLocalization }} 
              </nz-form-label>
              <nz-form-control [nzSm]="14" [nzXs]="24" nzHasFeedback>
                <input
                  nz-input
                  id="name"
                  formControlName="name"
                  [placeholder]="'BasicArchives::ModelPlaceHolder:Joy.Erp.BasicArchives.ItemMasters.ItemMaster.Name' | abpLocalization"
                  nz-tooltip
                  [nzTooltipTitle]="getErrorMessage('name')"
                  [nzTooltipVisible]="validateForm.get('name')?.invalid && validateForm.get('name')?.touched"
                  nzTooltipPlacement="top"
                />
              </nz-form-control>
            </nz-form-item>
          </div>
          <div nz-col [nzSpan]="8">            
            <nz-form-item>
              <nz-form-label [nzSm]="8" [nzXs]="24" nzFor="spec">
                {{ 'BasicArchives::ModelTitle:Joy.Erp.BasicArchives.ItemMasters.ItemMaster.Spec' | abpLocalization }} 
              </nz-form-label>
              <nz-form-control [nzSm]="14" [nzXs]="24" nzHasFeedback>
                <input
                  nz-input
                  id="spec"
                  formControlName="spec"
                  [placeholder]="'BasicArchives::ModelPlaceHolder:Joy.Erp.BasicArchives.ItemMasters.ItemMaster.Spec' | abpLocalization"
                  nz-tooltip
                  [nzTooltipTitle]="getErrorMessage('spec')"
                  [nzTooltipVisible]="validateForm.get('spec')?.invalid && validateForm.get('spec')?.touched"
                  nzTooltipPlacement="top"
                />
              </nz-form-control>
            </nz-form-item>
          </div>          
          <div nz-col [nzSpan]="8">
          </div>
          <div nz-col [nzSpan]="8">
            <nz-form-item>
              <nz-form-label [nzSm]="8" [nzXs]="24" nzRequired nzFor="unitGroupId">
                {{ 'BasicArchives::ModelTitle:Joy.Erp.BasicArchives.ItemMasters.ItemMaster.UnitGroupId' | abpLocalization }} 
              </nz-form-label>
              <nz-form-control [nzSm]="14" [nzXs]="24" nzHasFeedback>
                <widget-entity-ref-select
                  id="unitGroupId"
                  formControlName="unitGroupId"
                  [placeholder]="'BasicArchives::ModelPlaceHolder:Joy.Erp.BasicArchives.ItemMasters.ItemMaster.UnitGroupId' | abpLocalization"
                  [idKey]="'id'"
                  [labelKey]="'groupName'"
                  [showSelect]="showUnitGroupSelect"
                  [getDetail]="getUnitGroupDetail"
                  nz-tooltip
                  [nzTooltipTitle]="getErrorMessage('unitGroupId')"
                  [nzTooltipVisible]="validateForm.get('unitGroupId')?.invalid && validateForm.get('unitGroupId')?.touched"
                  nzTooltipPlacement="top"
                >
                </widget-entity-ref-select>
              </nz-form-control>
            </nz-form-item>
          </div>          
          <div nz-col [nzSpan]="8">
          </div>          
          <div nz-col [nzSpan]="8">
          </div>
          <div nz-col [nzSpan]="8">
            <nz-form-item>
              <nz-form-label [nzSm]="8" [nzXs]="24" nzFor="canBePurchased">
                {{ 'BasicArchives::ModelTitle:Joy.Erp.BasicArchives.ItemMasters.ItemMaster.CanBePurchased' | abpLocalization }} 
              </nz-form-label>
              <nz-form-control [nzSm]="14" [nzXs]="24" nzHasFeedback>
                <nz-switch
                  id="canBePurchased"
                  formControlName="canBePurchased"
                  nz-tooltip
                  [nzTooltipTitle]="getErrorMessage('canBePurchased')"
                  [nzTooltipVisible]="validateForm.get('canBePurchased')?.invalid && validateForm.get('canBePurchased')?.touched"
                  nzTooltipPlacement="top"
                ></nz-switch>
              </nz-form-control>
            </nz-form-item>
          </div>
          <div nz-col [nzSpan]="8">
            <nz-form-item>
              <nz-form-label [nzSm]="8" [nzXs]="24" nzFor="sellable">
                {{ 'BasicArchives::ModelTitle:Joy.Erp.BasicArchives.ItemMasters.ItemMaster.Sellable' | abpLocalization }} 
              </nz-form-label>
              <nz-form-control [nzSm]="14" [nzXs]="24" nzHasFeedback>
                <nz-switch
                  id="sellable"
                  formControlName="sellable"
                  nz-tooltip
                  [nzTooltipTitle]="getErrorMessage('sellable')"
                  [nzTooltipVisible]="validateForm.get('sellable')?.invalid && validateForm.get('sellable')?.touched"
                  nzTooltipPlacement="top"
                ></nz-switch>
              </nz-form-control>
            </nz-form-item>
          </div>
          <div nz-col [nzSpan]="8">
          </div>
          <div nz-col [nzSpan]="8">
            <nz-form-item>
              <nz-form-label [nzSm]="8" [nzXs]="24" nzFor="canBeProduced">
                {{ 'BasicArchives::ModelTitle:Joy.Erp.BasicArchives.ItemMasters.ItemMaster.CanBeProduced' | abpLocalization }} 
              </nz-form-label>
              <nz-form-control [nzSm]="14" [nzXs]="24" nzHasFeedback>
                <nz-switch
                  id="canBeProduced"
                  formControlName="canBeProduced"
                  nz-tooltip
                  [nzTooltipTitle]="getErrorMessage('canBeProduced')"
                  [nzTooltipVisible]="validateForm.get('canBeProduced')?.invalid && validateForm.get('canBeProduced')?.touched"
                  nzTooltipPlacement="top"
                ></nz-switch>
              </nz-form-control>
            </nz-form-item>
          </div>
          <div nz-col [nzSpan]="8">
            <nz-form-item>
              <nz-form-label [nzSm]="8" [nzXs]="24" nzFor="canBeOutsourced">
                {{ 'BasicArchives::ModelTitle:Joy.Erp.BasicArchives.ItemMasters.ItemMaster.CanBeOutsourced' | abpLocalization }} 
              </nz-form-label>
              <nz-form-control [nzSm]="14" [nzXs]="24" nzHasFeedback>
                <nz-switch
                  id="canBeOutsourced"
                  formControlName="canBeOutsourced"
                  nz-tooltip
                  [nzTooltipTitle]="getErrorMessage('canBeOutsourced')"
                  [nzTooltipVisible]="validateForm.get('canBeOutsourced')?.invalid && validateForm.get('canBeOutsourced')?.touched"
                  nzTooltipPlacement="top"
                ></nz-switch>
              </nz-form-control>
            </nz-form-item>
          </div>
          <div nz-col [nzSpan]="8">
          </div>
          <div nz-col [nzSpan]="8">
            <nz-form-item>
              <nz-form-label [nzSm]="8" [nzXs]="24" nzFor="enabled">
                {{ 'BasicArchives::ModelTitle:Joy.Erp.BasicArchives.ItemMasters.ItemMaster.Enabled' | abpLocalization }} 
              </nz-form-label>
              <nz-form-control [nzSm]="14" [nzXs]="24" nzHasFeedback>
                <nz-switch
                  id="enabled"
                  formControlName="enabled"
                  nz-tooltip
                  [nzTooltipTitle]="getErrorMessage('enabled')"
                  [nzTooltipVisible]="validateForm.get('enabled')?.invalid && validateForm.get('enabled')?.touched"
                  nzTooltipPlacement="top"
                ></nz-switch>
              </nz-form-control>
            </nz-form-item>
          </div>
        </div>
      </nz-tab>
    </nz-tabset>
  </form>

</nz-card> 